# 用户管理相关页面测试
from Lib.base.keywords import KeyWords
from selenium.webdriver.common.by import By
from Lib.common.common_function import *
from Lib.base.page_object.login_page import LonginPage
import uuid
import random


class CaseType(KeyWords):
    url = KeyWords.url + 'system-settings'

    def create_case_big_type(self):
        '''
        创建事件小类
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\case_type\case_type_create.yaml')
        element_operation(self, data[0]['data'])

    def create_case_small_type(self):
        '''
        创建事件小类
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\case_type\case_small_type_create.yaml')
        element_operation(self, data[0]['data'])

    def update_case_small_type(self):
        '''
        更新事件小类
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\case_type\case_small_type_update.yaml')
        element_operation(self, data[0]['data'])

    def delete_case_small_type(self):
        '''
        删除事件大类
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\case_type\case_small_type_delete.yaml')
        element_operation(self, data[0]['data'])

    def update_case_big_type(self):
        '''
        修改事件大类
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\case_type\case_big_type_update.yaml')
        element_operation(self, data[0]['data'])

    def delete_case_big_type(self):
        '''
        删除事件大类
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\case_type\case_big_type_delete.yaml')
        element_operation(self, data[0]['data'])


if __name__ == '__main__':
    driver = choose_browser()
    L = LonginPage(driver)
    L.login('kobeAdmin002', 'kobe8888')
    case = CaseType(driver)
    case.delete_case_big_type()
